package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_service;
import cn.com.api.entity.ApiU_zan;

//DAO
public interface U_serviceMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_service  WHERE service_id = #{service_id}")
	public ApiU_service findU_serviceById(Integer service_id);

	// 查看数据集
	@Select("SELECT * FROM U_service")
	public List<ApiU_service> findU_services();

	// 添加
	@Insert("INSERT INTO U_service (user_id, status, add_time, company_name, company_scale,service_address,service_time,ext1,ext2,ext3,ext4,ext5,partner,confirm_time) "
			+ "VALUES (#{user_id}, #{status}, #{add_time}, #{company_name}, #{company_scale},#{service_address},#{service_time},#{ext1},#{ext2},#{ext3},#{ext4},#{ext5},#{partner},#{confirm_time})")
	@Options(useGeneratedKeys = true, keyProperty = "service_id")
	public int insertU_service(ApiU_service u_service);

	// 修改
	@Update("UPDATE U_service SET user_id = #{user_id}, status = #{status}, add_time = #{add_time}, company_name = #{company_name}, company_scale = #{company_scale},service_address=#{service_address},"
			+ "service_time=#{service_time},ext1=#{ext1},ext2=#{ext2},ext3=#{ext3},ext4=#{ext4},ext5=#{ext5},partner = #{partner},confirm_time = #{confirm_time} WHERE service_id = #{service_id}")
	public int updateU_service(ApiU_service u_service);

	// 删除
	@Delete("DELETE FROM U_service WHERE ID = #{id}")
	public int deleteU_service(Integer id);

}
